package cn.study.feignclient.service;

import cn.study.feignclient.entity.Animal;
import cn.study.feignclient.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.Map;

@FeignClient(name="USER-SERVICE",path = "/user")
public interface UserSerivce {
    @PostMapping("/test1")
    public Map<String,Object> test1(Map<String,Object> dto);
    @GetMapping("/findById")
    public User findById(@RequestParam("id") Integer id);
    @GetMapping("/findByIdAndName")
    public User findByIdAndName(@RequestParam("id")Integer id,@RequestParam("name") String name);
    @GetMapping("/findByIdAndName")
    public User findByIdAndName(@RequestParam Map<String,Object> searchMap);

    @GetMapping("/findByCondition")
    public User findByCondition(Map<String,Object> condition);
    @GetMapping("/findByEntity")
    public User findByEntity(@RequestBody User user);
    @PostMapping("/addUser")
    public User addUser(User user);
    @PostMapping("/addUserMap")
    public Map<String,Object> addUserMap(Map<String,Object> user);
    @PostMapping("/test")
    public Map<String,Object> test(@RequestBody Map<String,Object> user,@RequestParam("key") String key);

}
